/***
* ==++==
*
* Copyright (c) Microsoft Corporation.  All rights reserved.
*
* ==--==
* =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
*
* context.h
*
* C++ Actors context
*
* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
****/

#pragma once

#include <memory>

namespace actors
{
/// <summary>
/// Base class for all contexts passed into hosted instances.
/// </summary>
struct _actor_context
{
    virtual ~_actor_context() {}

    /// <summary>
    /// Recast context as 'T' which must be a derived class.
    /// </summary>
    template<typename T> const T &as() { return *dynamic_cast<T *>(this); }
};
typedef std::shared_ptr<_actor_context> actor_context;

}